<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模板语法</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>

<body>
    <div id="root">
        <h1>插值语法</h1>
        <h3>你好，{{name}}</h3>

        <h1>模板语法</h1>
        <!-- 
            v-bind:或简写成: 表示单向绑定
         -->
        <a v-bind:href="url">点我去{{school.name1}}</a>
        <a :href="url">点我去{{school.name2}}</a>
    </div>

    <script type="text/javascript">

        const x = new Vue({
            el: "#root",
            data: {
                name: "张三",
                url: "http://www.baidu.com",
                school: {
                    name1: "王伟",
                    name2: "找了附件"
                }
            }
        })
    </script>
</body>

</html>